<?php
class DelType extends Action {
	/* (non-PHPdoc)
	 * @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$tid = rqst ( 'tid' );
		if (empty ( $tid )) {
			Response::errorPage ( "非法的类型编号", $this->referer );
		}
		$tM = new WebPageTypeModel ();
		$rst = $tM->deleteType ( $tid );
		if ($rst) {
			Response::redirect ( $this->referer );
		} else {
			Response::errorPage ( "在删除页面类型时发生了以下错误:<br/>" . $tM->last_error_msg (), $this->referer );
		}
	}
}